
package fei.zhou.zipkindemo02esclient8081.business.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * 描述该类
 * 
 * @class: HelloController
 * @date 2021/8/22 15:54
 * @author <a href="mailto:zhoufei@smartdot.com">周飞</a>
 * @Verson 1.0 -2021/8/22 15:54
 * @see
 */
@RestController
@RequestMapping("zipkin")
public class HelloController {
    
    public static final String url = "http://localhost:8082/zipkin/service2";
    
    @RequestMapping("/service1")
    public String service() throws Exception {
        System.out.println("-----调用service1-----");
        
        String data = restTemplate.getForObject(url, String.class);
        
        return "service1," + data;
    }
    
    @Autowired
    RestTemplate restTemplate;
    
}